﻿Imports System.Data
Imports CondorTravel.BC
Imports CondorTravel.BE
Imports CondorTravelUTIL.DL

Public Class ReporteEncuestas
    Inherits PaginaBase

    Dim itemgridview As GridViewRow
    Dim casilla As System.Web.UI.WebControls.CheckBox

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            LimpiarForm()

            txtInicio.Attributes.Add("readonly", "readonly")
            txtFin.Attributes.Add("readonly", "readonly")

            cle1.StartDate = "01/01/2000"

            cle2.StartDate = "01/01/2000"

            If Not Session("Nombre") Is Nothing Then
                txtCliente.Text = Session("Nombre").ToString
            End If
        End If
        If My.Request.Params("__EVENTTARGET") = "FuncionListCliente" Then
            CargarDatosCliente()
        End If



    End Sub


    Public Sub CargarDatosCliente()

        If Session("BCNombreCliente") = Nothing Then
            txtCliente.Text = String.Empty
        Else
            'txtCodigoProveedor.Text = Session("BPRazonSocialProveedor")
            txtCliente.Text = Session("BCNombreCliente")
        End If

    End Sub
    Sub LimpiarForm()
        txtCliente.Text = "" : txtInicio.Text = "" : txtFin.Text = ""
    End Sub

    Protected Sub btnNuevo_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnNuevo.Click
        Dim objUtil As New Funciones
        Dim strCliente, strFIni, strFFin As String
        strCliente = "" : strFIni = "" : strFFin = ""
        If txtFin.Text.Trim <> "" And txtInicio.Text.Trim <> "" Then
            If CDate(txtFin.Text) < CDate(txtInicio.Text) Then
                Alerta("La fecha final no debe ser menor que la fecha inicial", False, String.Empty)
                Exit Sub
            End If
        End If
        If txtCliente.Text.Trim <> "" Then
            strCliente = objUtil.ReemplazarTexto(txtCliente.Text.Trim)
        End If
        If txtInicio.Text.Trim <> "" Then
            strFIni = objUtil.ReemplazarTexto(txtInicio.Text.Trim)
        End If
        If txtFin.Text.Trim <> "" Then
            strFFin = objUtil.ReemplazarTexto(txtFin.Text.Trim)
        End If
        iFrm_Reporte.Attributes("src") = "../Reportes/RptEncuestas.aspx?strCli=" + strCliente.Trim + "&strFIni=" + strFIni.Trim + "&strFFin=" + strFFin.Trim
        'LimpiarForm()
    End Sub
     

End Class